<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
	<head>
		<meta charset="UTF-8">
		<script type="text/javascript" class="autoinsert" src="js/jquery-2.2.0.min.js"></script>
		<!-- bootstrap规定使用前置设置 -->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link href="bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="bootstrap-3.3.7-dist/js/bootstrap.js"></script>
		<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css">
		<link rel="stylesheet" type="text/css" href="css/houtai_updatehotel.css" />
		<script type="text/javascript" class="autoinsert" src="js/layer.js"></script>
		<link rel="stylesheet" type="text/css" href="css/layer.css" />
		<script type="text/javascript" src="js/houtai_updatehotel.js"></script>
		<title>修改旅店信息</title>
	</head>
	<body>
		
		<%@ include file="houtai_left.jsp"%>
		<%@ include file="houtai_top.jsp"%>
		
		<input type="hidden" id="show_left" value="${show_left}" />
		<script type="text/javascript">
			$("div[id*='left_y']").hide();
			var now_left = $("#now_left").val();
			$("#" + now_left).show();
			var show_left = $("#show_left").val();
			$("#" + show_left).attr("style", "background: #293038;");
		</script>
		
		<div class="main">
			
			<div class="main_top">
				<h5 class="main_top_text">修改旅店信息</h5>
			</div>
			
			<form action="${pageContext.request.contextPath}/updatehotel" method="post" name="form_add">
			<div class="main_content">
				<c:forEach var="U" items="${hotel}">
					<input type="hidden" id="id" name="id" value="${U.id}" />
				<div class="main_name">
					<div class="main_text">景点id：</div>
					<input type="text" id="pid" name="pid" value="${U.pid}"/>
				</div>
				<div class="main_name">
					<div class="main_text">旅店名：</div>
					<input type="text" id="name" name="name" value="${U.name}"/>
				</div>
				<div class="main_name">
					<div class="main_text">地址：</div>
					<input type="text" id="address" name="address" value="${U.address}"/>
				</div>
				<div class="main_name">
					<div class="main_text">营业时间：</div>
					<input type="text" id="time" name="time" value="${U.time}"/>
				</div>
				<div class="main_name">
					<div class="main_text">人均价格：</div>
					<input type="text" id="price" name="price" value="${U.price}"/>
				</div>
				<div class="main_name">
					<div class="main_text">电话：</div>
					<input type="text" id="phone" name="phone" value="${U.phone}"/>
				</div>
				<div class="main_name">
					<div class="main_text">介绍：</div>
					<input type="text" id="introduce" name="introduce" value="${U.introduce}"/>
				</div>
				<div class="main_name">
					<div class="main_text">旅店图片地址：</div>
					<input type="text" id="img" name="img" value="${U.img}"/>
				</div>
				</c:forEach>
				<button class="main_show_button" onclick="yes_update()"><a href="#" class="main_show_a">确认修改<i class="fa fa-check-square-o" style="padding-left: 5px;"></i></a></button>
			</div>
			
			<script type="text/javascript">
				function yes_update() {
					if($("#pid").val() != "" && $("#name").val() != "" && $("#address").val() != "" && $("#time").val() != "" && $("#price").val() != "" && $("#phone").val() != "" && $("#introduce").val() != "" && $("#img").val() != ""){
						form_add.submit();
					}else{
						layer.msg('请将信息完整输入!', {
							time: 2000
						});
					}
				}
			</script>
			
		</div>
		
	</body>
</html>
